<template>
  <div>
    <p>用户：<input type="text" v-model.trim="username"></p>
    <p>密码：<input type="text" v-model.trim="password"></p>
    <button @click="logined">登录</button>
  </div>
</template>

<script>
export default {
  name: "Login.vue",
  data() {
    return {
      username: "yykk",
      password: "123456"
    }
  },
  methods: {
    logined() {
      // 用path的方式
      //this.$router.push("/")
      // 用name得方式
      this.$router.push({name: 'index'})
    }
  }
}
</script>

<style scoped>

</style>